package com.hugedata.cdn.util;

import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.support.TransactionTemplate;

/**
 * 
 * 项目名称：cdn 类名称：CdnTransactionCallback 类描述： 创建人：zhaoaihua 创建时间�?013-3-21
 * 下午5:33:58 修改备注�?
 * 
 * @version
 * 
 */
public abstract class CdnTransactionCallback {

    /**
     * Gets called by {@link TransactionTemplate#execute} within a transactional
     * context. Does not need to care about transactions itself, although it can
     * retrieve and influence the status of the current transaction via the
     * given status object, e.g. setting rollback-only.
     */
    public Object doInTransaction(TransactionStatus status) throws CdnException {
        // if use it,must be implement it
        this.doInTransactionNoResult(status);
        return null;
    }

    /**
     * Gets called by {@link TransactionTemplate#execute} within a transactional
     * context. Does not need to care about transactions itself, although it can
     * retrieve and influence the status of the current transaction via the
     * given status object, e.g. setting rollback-only.
     */
    public void doInTransactionNoResult(TransactionStatus status)
            throws CdnException {
        // if use it,must be implement it
    }
}
